package com.hwua.springboot_start.component;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @program: springboot_start
 * @description:
 * @author: 韩海川3
 * @create: 2019-08-06 20:36
 **/
@Component
public class ScheduleComponent {

    @Scheduled(fixedRate = 1000)
    private void cronSchedule() {
        System.out.println(new Date().toString());
    }

    @Scheduled(fixedRate = 2000)
    private void demo() {
        System.out.println(new Date().toString());
    }

    @Scheduled(fixedRate = 3000)
    private void demo1() {
        System.out.println(new Date().toString());
    }

}
